/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.log.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import org.springblade.modules.course.entity.CourseEntity;
import org.springblade.modules.course.vo.CourseVO;
import org.springblade.modules.log.entity.IntegralLogEntity;
import org.springblade.modules.log.entity.IntegralTrainingEntity;
import org.springblade.modules.log.vo.IntegralLogVO;
import org.springblade.modules.log.excel.IntegralLogExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import org.springblade.modules.log.vo.IntegralViewVO;
import org.springblade.modules.material.entity.PaperReleaseEntity;

import java.util.List;

/**
 * 积分项导入日志 服务类
 *
 * @author junxin
 * @since 2023-05-18
 */
public interface IIntegralLogService extends BaseService<IntegralLogEntity> {
	/**
	 * 自定义分页
	 *
	 * @param page
	 * @param integralLog
	 * @return
	 */
	IPage<IntegralLogVO> selectIntegralLogPage(IPage<IntegralLogVO> page, IntegralLogVO integralLog);


	/**
	 * 导出数据
	 *
	 * @param queryWrapper
	 * @return
	 */
	List<IntegralLogExcel> exportIntegralLog(Wrapper<IntegralLogEntity> queryWrapper);

	IPage<IntegralViewVO> selectIntegralByUserId(IPage<IntegralViewVO> page,IntegralViewVO vo);
	List<IntegralLogEntity> selectByIdcard(String idcard);

	/**
	 * 标准积分记录，所有积分记录走这
	 * 新增积分记录，并且积分计入到年度积分 且记录到用户总积分
	 */
	boolean addIntegral(IntegralLogVO vo);

	/**
	 * 外部导入统一走这条
	 */
	boolean addIntegralImport(IntegralLogVO vo);

	/**
	 * 积分项编辑统一走这个
	 * 1.对比新旧数据的用户名
	 * 2.对比新旧数据的积分是否变动
	 */
	boolean updateIntegral(IntegralLogEntity integralLogEntity);

	/**
	 * 积分项删除统一走这个
	 */
	boolean deleteIntegral(Long integralLogId);


	IntegralLogVO generalIntegralByCourse(CourseEntity entity);
	IntegralLogVO generalIntegralByExam(PaperReleaseEntity entity);
	IntegralLogVO generalIntegralByTraining(IntegralTrainingEntity entity);

	/**
	 * 根据积分项导入
	 */
	IntegralLogVO generalIntegralByIntegral(IntegralLogEntity entity);

}
